import { http } from '@/utils/http/axios';

/**
 * @categoryName 根据用户id获取用户菜单
 */
export function getHeadImgCategory(categoryName) {
  return http.request({
    url: '/disk/admin/category/list',
    method: 'GET',
    params:{
      page:1,
      limit:100,
      categoryName
    }
  });
}
export function getHeadImgs(categoryId) {
  return http.request({
    url: '/disk/admin/resource',
    method: 'GET',
    params:{
      page:1,
      limit:100,
      categoryId
    }
  });
}
export function saveResource(categoryId,ossFileId) {
  return http.request({
    url: '/disk/admin/resource/save',
    method: 'PUT',
    params:{
            categoryId,
            ossFileId
          }
  });
}
export function deleteResource(id) {
  return http.request({
    url: '/disk/admin/resource/delete/' + id,
    method: 'DELETE'
  });
}
export function generateThumbnailFile(scale,categoryId) {
  return http.request({
    url: 'disk/admin/resource/generateThumbnailFile',
    method: 'GET',
    params:{
      scale,
      categoryId
    }
  });
}


